//
//  FMDB.m
//  Cartoon
//
//  Created by dllo on 15/10/29.
//  Copyright © 2015年 YSZ. All rights reserved.
//

#import "FMDB.h"

@implementation FMDB
+ (instancetype)shareFMDB
{
    
    static FMDB *fmdb = nil;
    
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        
        fmdb = [[FMDB alloc]init];
        
    });
    return fmdb;
}
- (FMDatabase *)db
{
    NSString *dbPath = [NSString stringWithFormat:@"%@/Documents/1.rdb",NSHomeDirectory()];
    if (!_db) {
        self.db = [FMDatabase databaseWithPath:dbPath];
    }
    NSLog(@"%@",dbPath);
    return _db;
}
@end
